import request from '@/api/request'

//添加商品信息
 function addProductAndSkus(data) {
  return request({
    url: '/lejuAdmin/product/addProductAndSkus',
    method: 'POST',
    data
  })
}
//删除商品信息
function del(productId,data) {
    return request({
      url:`/lejuAdmin/product/del/${productId}`,
      method: 'DELETE',
      data
    })
  }
//查询商品明细,用于编辑
function productSkusDetail(productId,data) {
    return request({
      url:`/lejuAdmin/product/productSkusDetail/${productId}`,
      method: 'GET',
      data
    })
  }
//分页查询商品列表
function productsByPage(start,limit,data) {
    return request({
      url:`/lejuAdmin/product/productsByPage/${start}/${limit}`,
      method: 'POST',
      data
    })
  }
//更改是否最新
function switchNewStatus(data) {
    return request({
      url: '/lejuAdmin/product/switchNewStatus',
      method: 'POST',
      data
    })
  }
//更改是否预告
function switchPreviewStatus(data) {
    return request({
      url: '/lejuAdmin/product/switchPreviewStatus',
      method: 'POST',
      data
    })
  }
//更改发布状态
function switchPublishStatus(data) {
    return request({
      url: '/lejuAdmin/product/switchPublishStatus',
      method: 'POST',
      data
    })
  }
//更改是否推荐
function switchRecommandStatus(data) {
    return request({
      url: '/lejuAdmin/product/switchRecommandStatus',
      method: 'POST',
      data
    })
  }
//更改审核状态
function switchVerifyStatus(data) {
    return request({
      url: '/lejuAdmin/product/switchVerifyStatus',
      method: 'POST',
      data
    })
  }
//更改商品信息
function updateProductAndSkus(data) {
    return request({
      url: '/lejuAdmin/product/updateProductAndSkus',
      method: 'POST',
      data
    })
  }
export default{
    addProductAndSkus,del,productSkusDetail,productsByPage,
    switchNewStatus,switchPreviewStatus,switchPublishStatus,
    switchRecommandStatus,switchVerifyStatus,updateProductAndSkus
}
